# from aip import AipContentCensor
#
# """ 你的 APPID AK SK """
#
#
# def baiduai():
# 	APP_ID = '46401374'
# 	API_KEY = 'Gz7zsW4Rpoil6lORbj5W4wHq'
# 	SECRET_KEY = 'yivMfTzeoBzTM5k69U8OsYzX6HAaZqQl'
# 	client = AipContentCensor(APP_ID, API_KEY, SECRET_KEY)


from aip import AipContentCensor
APP_ID = '46401374'
API_KEY = 'Gz7zsW4Rpoil6lORbj5W4wHq'
SECRET_KEY = 'yivMfTzeoBzTM5k69U8OsYzX6HAaZqQl'
client = AipContentCensor(APP_ID, API_KEY, SECRET_KEY)




# import requests
#
# API_KEY = "Gz7zsW4Rpoil6lORbj5W4wHq"
# SECRET_KEY = "yivMfTzeoBzTM5k69U8OsYzX6HAaZqQl"
#
#
#
# def main(text):
# 	url = "https://aip.baidubce.com/rest/2.0/solution/v1/img_censor/v2/user_defined?access_token=" + get_access_token()
#
# 	payload = text
# 	headers = {
# 		'Content-Type': 'application/x-www-form-urlencoded',
# 		'Accept': 'application/json'
# 	}
#
# 	response = requests.request("POST", url, headers=headers, data=payload)
# 	print(response.text)
#
# 	return response.text
#
#
# def get_access_token():
# 	"""
# 	使用 AK，SK 生成鉴权签名（Access Token）
# 	:return: access_token，或是None(如果错误)
# 	"""
# 	url = "https://aip.baidubce.com/oauth/2.0/token"
# 	params = {"grant_type": "client_credentials", "client_id": API_KEY, "client_secret": SECRET_KEY}
# 	return str(requests.post(url, params=params).json().get("access_token"))
#
#
# #
# # if __name__ == '__main__':
# #     main("傻逼")
